import { createRouter, createWebHistory } from 'vue-router'



const route = [
  {
    path: '/',
    name: 'home',
    redirect: "/main",
    meta: {
      title: '首页',
    },
    component: ()=>import("@/views/Home.vue"),
    children:[
      {
        path: '/main',
        name: 'main',
        meta: {
          title: '首页',
        },
        component: ()=>import("../views/Main.vue"),
      },
      {
        path: '/asset-list',
        name: 'asset-list',
        meta: {
          title: '资产清单',
        },
        component: ()=>import("@/views/asset/AssetList.vue"),
      },
      {
        path: '/asset-category',
        name: 'asset-category',
        meta: {
          title: '资产分类',
        },
        component: ()=>import("../views/asset/AssetCategory.vue"),
      },
      {
        path: '/asset-location',
        name: 'asset-location',
        meta: {
          title: '资产位置',
        },
        component: ()=>import("../views/asset/AssetLocation.vue"),
      },
      {
        path: '/asset-borrow',
        name: 'asset-borrow',
        meta: {
          title: '资产借用',
        },
        component: ()=>import("../views/asset/AssetBorrow.vue"),
      },
      {
        path: '/asset-return',
        name: 'asset-return',
        meta: {
          title: '资产归还',
        },
        component: ()=>import("../views/asset/AssetReturn.vue"),
      },
      {
        path: '/asset-fix',
        name: 'asset-fix',
        meta: {
          title: '资产维修',
        },
        component: ()=>import("../views/asset/AssetFix.vue"),
      },
      {
        path: '/asset-transfer',
        name: 'asset-transfer',
        meta: {
          title: '资产调拨',
        },
        component: ()=>import("../views/asset/AssetTransfer.vue"),
      },
      {
        path: '/asset-disposal',
        name: 'asset-disposal',
        meta: {
          title: '资产处置',
        },
        component: ()=>import("../views/asset/AssetDisposal.vue"),
      },
      {
        path: '/consumables-list',
        name: 'consumables-list',
        meta: {
          title: '耗材清单',
        },
        component: ()=>import("../views/consumables/ConsumablesList.vue"),
      },
      {
        path: '/consumables-category',
        name: 'consumables-category',
        meta: {
          title: '耗材类别',
        },
        component: ()=>import("../views/consumables/ConsumablesCategory.vue"),
      },
      {
        path: '/consumables-store',
        name: 'consumables-store',
        meta: {
          title: '耗材出库',
        },
        component: ()=>import("../views/consumables/ConsumablesStore.vue"),
      },
      {
        path: '/consumables-disposal',
        name: 'consumables-disposal',
        meta: {
          title: '耗材处置',
        },
        component: ()=>import("../views/consumables/ConsumablesDisposal.vue"),
      },
      {
        path: '/my-process',
        name: 'my-process',
        meta: {
          title: '审批管理',
        },
        component: ()=>import("../views/process/MyProcessList.vue"),
      },
      {
        path: '/process-template',
        name: 'process-template',
        meta: {
          title: '流程管理',
        },
        component: ()=>import("../views/process/ProcessTempleList.vue"),
      },
      {
        path: '/system-department',
        name: 'system-department',
        meta: {
          title: '部门管理',
        },
        component: ()=>import("../views/system/Department.vue"),
      },
      {
        path: '/system-user',
        name: 'system-user',
        meta: {
          title: '用户管理',
        },
        component: ()=>import("../views/system/User.vue"),
      },
      {
        path: '/emp-process-list',
        name: 'emp-process-list',
        meta: {
          title: '员工申请',
        },
        component: ()=>import("../views/process/EmpProcessList.vue"),
      },
      {
        path: '/inventory-check',
        name: 'inventory-check',
        meta: {
          title: '资产盘点',
        },
        component: ()=>import("../views/asset/InventoryCheck.vue"),
      },
      {
        path: '/consumable-check',
        name: 'consumable-check',
        meta: {
          title: '耗材盘点',
        },
        component: ()=>import("../views/consumables/ConsumablesCheck.vue"),
      },
      {
        path: '/consumables-borrow',
        name: 'consumables-borrow',
        meta: {
          title: '耗材出库',
        },
        component: ()=>import("../views/consumables/ConsumablesBorrow.vue"),
      },
      {
        path:"/consumables-transfer",
        name: 'consumables-transfer',
        meta:{
          title:"耗材调拨"
        },
        component:()=>import("@/views/consumables/ConsumablesTransfer.vue"),
      },
      {
        path:"/check-asset-detail",
        name: 'check-asset-detail',
        meta:{
          title:"盘点详情"
        },
        component:()=>import("@/views/asset/InventoryCheckDetail.vue"),
      },
      {
        path:"/check-material-detail",
        name: 'check-material-detail',
        meta:{
          title:"盘点详情"
        },
        component:()=>import("@/views/consumables/ConsumablesCheckDetail.vue"),
      }
      
    ]
  },
  {
    path: '/login',
    name: 'login',
    meta: {
      title: '登录',
    },
    component: ()=>import("../views/Login.vue"),
  },
  {
    path: "/:pathMatch(.*)*",
    component: () => import('../views/404.vue'),
  }
]


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes:route
})

export default router
